local TweenService = game:GetService("TweenService")
local UIRoot=Instance.new("ScreenGui",game.Players.LocalPlayer:WaitForChild("PlayerGui"))
UIRoot.IgnoreGuiInset=true
local M={}
local world2ScreenTween = TweenInfo.new(1, Enum.EasingStyle.Linear);

M.world2Screen = function(PullFuc,PushFuc,WorldPos,ScreenPos,endSize,startSize)

    if not startSize then
      startSize=UDim2.fromOffset(endSize.X/2,endSize.Y/2)
    else
      startSize=UDim2.fromOffset(startSize.X,startSize.Y)
    end
   
    endSize=UDim2.fromOffset(endSize.X,endSize.Y)
    
    ScreenPos=UDim2.fromOffset(ScreenPos.X,ScreenPos.Y)

   local image=PullFuc()
   image.Parent=UIRoot
   image.Visible=true
  local startPos=  game.Workspace.CurrentCamera:WorldToScreenPoint(WorldPos)
  image.Position=UDim2.fromOffset(startPos.X,startPos.Y)
  image.Size=startSize
  local t = TweenService:Create(image,world2ScreenTween, {
    Size=endSize,
    Position=ScreenPos
})
  t.Completed:Connect(function()
    t:Destroy()
    PushFuc(image)
  end)
  t:Play()

end;



return M